View Javadoc

1   /*
2   * Copyright 2005 Arnaud Prost
3   * 
4   * Arnaud.prost@gmail.com
5   * 
6   * This software is a computer program whose purpose is to ease the 
7   * management of software project.
8   * 
9   * This software is governed by the CeCILL  license under French law and
10  * abiding by the rules of distribution of free software.  You can  use, 
11  * modify and/ or redistribute the software under the terms of the CeCILL
12  * license as circulated by CEA, CNRS and INRIA at the following URL
13  * "http://www.cecill.info". 
14  * 
15  * As a counterpart to the access to the source code and  rights to copy,
16  * modify and redistribute granted by the license, users are provided only
17  * with a limited warranty  and the software's author,  the holder of the
18  * economic rights,  and the successive licensors  have only  limited
19  * liability. 
20  * 
21  * In this respect, the user's attention is drawn to the risks associated
22  * with loading,  using,  modifying and/or developing or reproducing the
23  * software by the user in light of its specific status of free software,
24  * that may mean  that it is complicated to manipulate,  and  that  also
25  * therefore means  that it is reserved for developers  and  experienced
26  * professionals having in-depth computer knowledge. Users are therefore
27  * encouraged to load and test the software's suitability as regards their
28  * requirements in conditions enabling the security of their systems and/or 
29  * data to be ensured and,  more generally, to use and operate it in the 
30  * same conditions as regards security. 
31  * 
32  * The fact that you are presently reading this means that you have had
33  * knowledge of the CeCILL license and that you accept its terms.
34  */
35  
36  package net.sf.pmr.agilePlanning.domain.story;
37  
38  import java.util.Set;
39  
40  import net.sf.pmr.agilePlanning.domain.iteration.Iteration;
41  import net.sf.pmr.core.domain.basicProject.BasicProject;
42  import net.sf.pmr.keopsframework.domain.object.AbstractDomainObject;
43  
44  import org.apache.commons.lang.builder.EqualsBuilder;
45  import org.apache.commons.lang.builder.HashCodeBuilder;
46  /***
47   * @author Arnaud Prost (arnaud.prost@gmail.com)
48   */
49  public class StoryImpl extends AbstractDomainObject implements Story {
50  
51      /***
52       * short description
53       */
54      private String shortDescription;
55  
56      /***
57       * description
58       */
59      private String description;
60  
61      /***
62       * estimate
63       */
64      private int estimate;
65  
66      /***
67       * iteration
68       */
69      private Iteration iteration;
70  
71      /***
72       * tasks
73       */
74      private Set tasks;
75  
76      /***
77       * Basic project
78       */
79      private BasicProject basicProject;
80  
81      /***
82       * @see net.sf.pmr.agilePlanning.domain.story.Story#getShortDescription()
83       */
84      public String getShortDescription() {
85          return this.shortDescription;
86      }
87  
88      /***
89       * @see net.sf.pmr.agilePlanning.domain.story.Story#setShortDescription(java.lang.String)
90       */
91      public void setShortDescription(final String shortDescription) {
92          this.shortDescription = shortDescription;
93      }
94  
95      /***
96       * @see net.sf.pmr.agilePlanning.domain.story.Story#getDescription()
97       */
98      public String getDescription() {
99          return this.description;
100     }
101 
102     /***
103      * @see net.sf.pmr.agilePlanning.domain.story.Story#setDescription(java.lang.String)
104      */
105     public void setDescription(final String description) {
106        this.description = description;
107 
108     }
109 
110     /***
111      * @see net.sf.pmr.agilePlanning.domain.story.Story#getEstimate()
112      */
113     public int getEstimate() {
114         return this.estimate;
115     }
116 
117     /***
118      * @see net.sf.pmr.agilePlanning.domain.story.Story#setEstimate(int)
119      */
120     public void setEstimate(final int estimate) {
121         this.estimate = estimate;
122 
123     }
124 
125     /***
126      * @see net.sf.pmr.agilePlanning.domain.story.Story#getIteration()
127      */
128     public Iteration getIteration() {
129         return this.iteration;
130     }
131 
132     /***
133      * @see net.sf.pmr.agilePlanning.domain.story.Story#setIteration(net.sf.pmr.agilePlanning.domain.Iteration)
134      */
135     public void setIteration(final Iteration iteration) {
136         this.iteration = iteration;
137     }
138 
139     /***
140      * @see net.sf.pmr.agilePlanning.domain.story.Story#getTasks()
141      */
142     public Set getTasks() {
143         return this.tasks;
144     }
145 
146     /***
147      * @see net.sf.pmr.agilePlanning.domain.story.Story#setTasks(java.util.List)
148      */
149     public void setTasks(final Set tasks) {
150        this.tasks = tasks;
151     }
152 
153 
154     /***
155      * @see net.sf.pmr.agilePlanning.domain.story.Story#getBasicProject()
156      */
157     public BasicProject getBasicProject() {
158         return basicProject;
159     }
160 
161     /***
162      * @see net.sf.pmr.agilePlanning.domain.story.Story#setBasicProject(BasicProject)
163      */
164     public void setBasicProject(final BasicProject basicProject) {
165         this.basicProject = basicProject;
166     }
167 
168     /***
169      * @see java.lang.Object#equals(Object)
170      */
171     // TODO à modifier et tester unitairement pour tenir compte du projet
172     public boolean equals(final Object object) {
173         if (!(object instanceof StoryImpl)) {
174             return false;
175         }
176         StoryImpl rhs = (StoryImpl) object;
177         return new EqualsBuilder().append(
178                 this.shortDescription, rhs.shortDescription).append(this.iteration,
179                 rhs.iteration).append(this.basicProject,
180                         rhs.basicProject).isEquals();
181     }
182 
183 
184     /***
185      * @see java.lang.Object#hashCode()
186      */
187     // TODO à modifier et tester unitairement pour tenir compte du projet
188     public int hashCode() {
189         return new HashCodeBuilder(258479881, -53180989)
190                 .append(this.shortDescription).append(
191                         this.iteration).append(
192                                 this.basicProject).toHashCode();
193     }
194 }